// @(#)log.hh
// Time-stamp: <2008-12-31 18:10:34 lancer>
// Copyright 2008 Julian Qian
// Author: root@localhost.localdomain
// Version: $Id: log.hh,v 0.0 2008/11/16 07:39:35 root Exp $
// Keywords: 
//

#ifndef _LOG_H
#define _LOG_H 1

// #include <log4cxx/defaultconfigurator.h>
// #include <log4cxx/logger.h>
#include <log4cxx/basicconfigurator.h>


using namespace log4cxx;
// using namespace log4cxx::helpers;

#define LEND LOG4CXX_ENDMSG

#define LDebug(l) LOG4CXX_DEBUG(Log::theLog(), l)
#define LInfo(l)  LOG4CXX_INFO(Log::theLog(), l)
#define LFatal(l) LOG4CXX_FATAL(Log::theLog(), l)

class Log {
public:
    static LoggerPtr theLog();
    static void endLog();
    // logstream LDebug(logger, Level::getDebug());
    // logstream LInfo(logger, Level::getInfo());
    // logstream LWarn(logger, Level::getWarn());
    // logstream LError(logger, Level::getError());
    // logstream LFatal(logger, Level::getFatal());
    int getFileCount(const char* dir, const LogString& initial);
    void tearDown();
private:
    Log();
    virtual ~Log();

    static Log* _theLog;
};

// typedef helpers::ObjectPtrT<Log> LogPtr;

#endif /* _LOG_H */

